<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="SacEditDlg" widgetVar="SacEditDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.EditSacTitle}">
            <h:form id="SacEditForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{sacController.selected != null}">
                        <p:outputLabel value="#{bundle.EditSacLabel_id}" for="id" />
                        <p:inputText id="id" value="#{sacController.selected.id}" title="#{bundle.EditSacTitle_id}" required="true" requiredMessage="#{bundle.EditSacRequiredMessage_id}"/>
                        <p:outputLabel value="#{bundle.EditSacLabel_dataCadastro}" for="dataCadastro" />
                        <p:calendar locale="pt"  id="dataCadastro" pattern="MM/dd/yyyy" value="#{sacController.selected.dataCadastro}" title="#{bundle.EditSacTitle_dataCadastro}" required="true" requiredMessage="#{bundle.EditSacRequiredMessage_dataCadastro}" showOn="button"/>
                        <p:outputLabel value="#{bundle.EditSacLabel_assunto}" for="assunto" />
                        <p:inputText id="assunto" value="#{sacController.selected.assunto}" title="#{bundle.EditSacTitle_assunto}" required="true" requiredMessage="#{bundle.EditSacRequiredMessage_assunto}"/>
                        <p:outputLabel value="#{bundle.EditSacLabel_tbInstCodInstituicao}" for="tbInstCodInstituicao" />
                        <p:selectOneMenu id="tbInstCodInstituicao" value="#{sacController.selected.tbInstCodInstituicao}" required="true" requiredMessage="#{bundle.EditSacRequiredMessage_tbInstCodInstituicao}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{tbInstController.itemsAvailableSelectOne}"
                                           var="tbInstCodInstituicaoItem"
                                           itemValue="#{tbInstCodInstituicaoItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{sacController.update}" value="#{bundle.Save}" update="display,:SacListForm:datalist,:growl" oncomplete="handleSubmit(args, 'SacEditDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="SacEditDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
